<%@ page import="cn.tedu.web.stm.JdbcUtils" %>
<%@ page import="java.util.List" %>
<%@ page import="cn.tedu.web.stm.homework.Goods" %>
<%@ page import="cn.tedu.web.stm.homework.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%
    String sql="SELECT * FROM `goods`";
    List<Goods> goods = JdbcUtils.selects(sql, Goods.class);
    String sql1="SELECT *FROM `user`";
    List<User> user = JdbcUtils.selects(sql1, User.class);
    String id = session.getAttribute("UID").toString();
    String sql2 = "SELECT `name` FROM `user` WHERE id="+id;
    User select = JdbcUtils.select(sql2, User.class);
%>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java实训团队协作简单案例</title>
    <link rel="shortcut icon" href="assets/img/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="assets/vendors/font-awesome-4.7.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="assets/css/core.css" />
    <link rel="stylesheet" href="assets/css/index.css" />

    <link rel="stylesheet" href="assets/css/welcome.css" />
</head>

<body>
    <jsp:include page="/WEB-INF/tpl/stm/header.jsp"/>
    <section class="container">
        <jsp:include page="/WEB-INF/tpl/stm/side.jsp"/>
        <div class="main-right">
            <h3>欢迎您，<%=select.getName()%></h3>
            <div class="summary-container">
<%--                <div class="summary-category">--%>
<%--                    <div class="summary-desc">--%>
<%--                        <span class="summary-title">分类总数</span>--%>
<%--                        <span class="summary-value">20</span>--%>
<%--                    </div>--%>
<%--                    <div class="summary-icon">--%>
<%--                        <i class="fa fa-star-o"></i>--%>
<%--                    </div>--%>
<%--                </div>--%>
                    <div class="summary-goods">
                        <a href="goods-list.jsp">
                        <div class="summary-desc">
                            <span class="summary-title">商品总数</span>
                            <span class="summary-value"><%=goods.size()%></span>
                        </div>
                        <div class="summary-icon">
                            <i class="fa fa-bars"></i>
                        </div>
                        </a>
                    </div>

                    <div class="summary-user">
                        <a href="user-list.jsp">
                        <div class="summary-desc">
                            <span class="summary-title">用户总数</span>
                            <span class="summary-value"><%=user.size()%></span>
                        </div>
                        <div class="summary-icon">
                            <i class="fa fa-users"></i>
                        </div>
                        </a>
                    </div>
            </div>
        </div>
    </section>
</body>

</html>